<?php if (!defined('THINK_PATH')) exit();?>
 <html>
   <head>
		<meta  charset="utf-8">
		<style>
		a{
		  text-decoration:none;
		}
		
		  .current{
		  
		  background-color:#ddd;
		   color:red;
		  }
		.prev,.num,.next,.current{
		 width:auto;
		 height:auto;
		 margin:4px;
		 border:1px solid #ddd;
		 padding:1px 2px;
		
		 box-shadow:0 0 2px rgba(0,0,0,0.2);
		 background-color:rgba(255,255,255,0.1);
		 }

		</style>
   </head>

   <body>
 
		<center>
			 <h3>学生管理系统</h3>
			 <a href="<?php echo U('index/select');?>">查看信息</a>
		     <a href="<?php echo U('index/add');?>">添加信息</a>
		     <hr>  
			
			 <form action="<?php echo U('index/select');?>"   method="get">
			   <b> 姓名:</b><input type="text" name="name" size="5" value="<?php echo ((isset($name ) && ($name !== ""))?($name ):''); ?>">
			   <b> 性别:</b><select  name="sex">
					  <option value="" >--全部--</option>
					  <option value="1"  <?php echo ($sex ==1?selected:''); ?> >男</option>
					  <option value="0" <?php echo ($sex ===0?selected:''); ?>>女</option>
					 </select>
			   <input type="submit" value="搜索">
			 </form>
		  
			<table  width="700"  border="1" cellspacing="0"  >
			   <tr>
					<th>id</th>
					<th>名字</th>
					<th>年龄</th>
					<th>头像</th>
					<th>性别</th>
					<th>班级</th>
					<th>操作</th>
			   </tr>
			    <?php if(is_array($list)): foreach($list as $key=>$vo): ?><tr>
						<td><?php echo ($vo["id"]); ?></td>
						<td><?php echo ($vo["name"]); ?></td>
						<td><?php echo ($vo["age"]); ?></td>
						<td><a href="<?php echo U('index/pic');?>?pic=<?php echo ($vo["pic"]); ?>"><img src="<?php echo (APP_INDEX); ?>/uploads/s_<?php echo ($vo["pic"]); ?>"  title="<?php echo ($vo["pic"]); ?>"></a></td>
						<td><?php echo ($vo['sex'] == 1?"男":"女"); ?></td>
						<td><?php echo ($vo["class"]); ?></td>
						<td><a href="<?php echo U('index/edit');?>?id=<?php echo ($vo['id']); ?>">修改</a> | <a href="<?php echo U('index/del');?>?id=<?php echo ($vo['id']); ?>&pic=<?php echo ($vo['pic']); ?>">删除</a></td>
					</tr><?php endforeach; endif; ?>
			</table>
			<br>
			<div><?php echo ($pageinfo); ?></div>
		</center>
   </body>
 </html>